ALONECOLOUR DIALOGUE FORMAT — VERSION 1

Top-level fields:
format: exactly "alonecolour-dialogue"
version: 1
title: nonempty string, up to 120 characters
character: object containing name, role, want and voice strings, up to 600 characters each
start: ID of the starting scene
flags: object containing up to 20 named boolean story facts
nodes: array of 1–60 scenes

Scene:
id: unique lower-case ID beginning with a letter; letters, numbers and underscores; up to 40 characters
title: nonempty string, up to 120 characters
text: nonempty dialogue string, up to 3000 characters
choices: array of 0–8 choices; zero choices makes an ending

Choice:
text: nonempty player-facing string, up to 240 characters
to: ID of an existing scene
when: optional {"flag":"has_key","value":true}; the choice is available only when the flag has that boolean value
set: optional {"flag":"has_key","value":true}; after choosing, set that flag to the boolean value

No expressions, executable code, nested conditions or numeric variables are supported. Use additional scenes or facts to represent a more complicated decision. Names constructor, prototype and __proto__ are rejected. File imports are capped at1MB. Content is displayed as text, not injected HTML.

Runtime:
1. Copy the initial flags and enter start.
2. Show the current scene's text and choices whose optional condition matches.
3. On choice, verify its condition again, record the choice, apply its optional state change and move to the destination.
4. An ending has no choices. A scene with choices but no currently available choice shows a clear message; it does not spin in a loop.
5. Restart resets scene, facts and history.

Browser API: ACDialogue.validate(document), parse(JSONstring), create(document), clone(document).
Core runtime: scene, state, history, choices(), choose(originalChoiceIndex), restart(). Available choices retain their original index; do not substitute the filtered list index when calling choose().
Node/CommonJS: require the core file. There are no third-party dependencies.

An engine adapter must implement the same state/condition rules, display/input, saving and restart, then run both example endings and the locked-choice checks. JSON parsing support in an engine is not proof that an adapter works. The browser editor, not a Godot or Unity integration, is the deliverable tested here.
